/**
 * 
 */
package org.cuatrovientos.Dado;

/**
 * "Yo, thats a fucking dice bitch" (Jesse from Breaking bad)
 * @author inigo_cilveti
 *
 */
public class Dado {

        //attributes
        private int sides;
        private boolean AdmitsZero = true;
       
        //constructor
        public Dado () {
                this.sides=6;
        }
        
        
        
        /**
         * yo, creates a dice with a certain number of sides... yo.. (is this shit on german or smthing? I mean, "dado"? WTF? )
         * @param sides
         */
        public Dado (int sides, boolean AdmitsZero) {
                this.sides=sides;
                this.AdmitsZero=AdmitsZero;
        }
        //methods
        /**
         * time to play yo, roll that motherfucker bitch!
         * @return value
         */
        public int roll () {
                
        	if (AdmitsZero==true){
                return (int) (Math.random()*this.sides);
    			}
        	else{
        		return (int) (Math.random()*this.sides+1);
        	}
        }
        	public static void main(String[] args) {
        		 System.out.println("Introduce elemento: ");
        		Dado Midado=new Dado();
                for(int i =0;i <10;i++){
                System.out.println(Midado.roll());
                }
                Dado d20=new Dado(18, true);
                for(int i =0;i <10;i++){
                System.out.println(d20.roll());
                }
        		}
        	}
        
       
